import request from '@/common/js/request'

// 查询评论分页列表
export function pageYrComment(page) {
    return request({
        url: '/api-blog/web/comment/page',
        method: 'post',
        data: page
    })
}

// 查询评论列表
export function listYrComment(query) {
    return request({
        url: '/api-blog/web/comment/list',
        method: 'get',
        params: query
    })
}

// 查询根据文章id查询评论树形
export function listTreeArticleComment(articleId) {
    return request({
        url: '/api-blog/web/comment/listTreeArticleComment/'+articleId,
        method: 'get'
    })
}

// 查询评论详细
export function infoYrComment(yrCommentId) {
    return request({
        url: '/api-blog/web/comment/info/' + yrCommentId,
        method: 'get'
    })
}


// 新增评论
export function addYrComment(data) {
    return request({
        url: '/api-blog/web/comment/add',
        method: 'post',
        data: data
    })
}

// 修改评论
export function editYrComment(data) {
    return request({
        url: '/api-blog/web/comment/edit',
        method: 'put',
        data: data
    })
}

// 删除评论
export function removeYrComment(yrCommentId) {
    return request({
        url: '/api-blog/web/comment/remove/' + yrCommentId,
        method: 'delete'
    })
}